﻿Imports System.Data.Linq
Imports System.Linq

Public Class ForeignCompanyRepository

    Private dc As New TanNamChinhDataContext

    Public Sub New()
        dc = GeneralClassDAL.dc
    End Sub

    'Public Function SelectAllRecord() As IQueryable(Of tblForeignCompany)
    '    Dim query = From p In dc.tblForeignCompanies
    '                    Select p
    '    Return query
    'End Function

    'Public Function SelectRecordById(ByVal id As Integer) As tblForeignCompany
    '    Dim query = dc.tblForeignCompanies.SingleOrDefault(Function(p As tblForeignCompany) p.ID_ForeignCompany = id)
    '    Return query
    'End Function

    'Public Function SelectRecordByName(ByVal isExport As Integer, ByVal Name As String) As tblForeignCompany
    '    Dim query = dc.tblForeignCompanies.SingleOrDefault(Function(p As tblForeignCompany) p.Name = Name And (p.IsExport = isExport Or p.IsExport = 2)) ' And p.IsActive = True)
    '    Return query
    'End Function

    'Public Sub Insert(ByVal obj As tblForeignCompany)
    '    dc.tblForeignCompanies.InsertOnSubmit(obj)
    '    dc.SubmitChanges()
    'End Sub

    'Public Sub Update(ByVal obj As tblForeignCompany)
    '    dc.Refresh(RefreshMode.OverwriteCurrentValues, obj)
    '    dc.SubmitChanges()
    'End Sub

    'Public Function SelectAllRecord(ByVal IsExport As Boolean) As IQueryable(Of tblForeignCompany)
    '    Dim query = From p In dc.tblForeignCompanies
    '                Where p.IsExport = IsExport
    '                Select p
    '    Return query
    'End Function
End Class
